import React from 'react'

export default class MessageHeader extends React.Component {

  isGroup() {
    return this.props.contacter &&
      this.props.contacter.type === 'GROUP'
  }

  render() {
    return (
      <header className="bar bar--gray weui-flex">
        <div className="title weui-flex__item">聊天记录</div>
        <ul className="bar-right">
        { this.isGroup() &&
          <li className="bar-item">
            <i className="iconfont icon-user" title="群成员"></i>
            { this.props.contacter.memberCount }
          </li>
        }
        <li className="bar-item">
          <i className="iconfont icon-comment" title="聊天记录"></i>
          { this.props.messageCount }
        </li>
        </ul>
      </header>
    )
  }
}
